/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.targeter.rulesengine.service.persistence;

import com.liferay.portal.service.persistence.BasePersistence;

import com.targeter.rulesengine.model.rules;

/**
 * The persistence interface for the rules service.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author jsalaice
 * @see rulesPersistenceImpl
 * @see rulesUtil
 * @generated
 */
public interface rulesPersistence extends BasePersistence<rules> {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this interface directly. Always use {@link rulesUtil} to access the rules persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
	 */

	/**
	* Caches the rules in the entity cache if it is enabled.
	*
	* @param rules the rules
	*/
	public void cacheResult(com.targeter.rulesengine.model.rules rules);

	/**
	* Caches the ruleses in the entity cache if it is enabled.
	*
	* @param ruleses the ruleses
	*/
	public void cacheResult(
		java.util.List<com.targeter.rulesengine.model.rules> ruleses);

	/**
	* Creates a new rules with the primary key. Does not add the rules to the database.
	*
	* @param ruleId the primary key for the new rules
	* @return the new rules
	*/
	public com.targeter.rulesengine.model.rules create(long ruleId);

	/**
	* Removes the rules with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param ruleId the primary key of the rules
	* @return the rules that was removed
	* @throws com.targeter.rulesengine.NoSuchrulesException if a rules with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.targeter.rulesengine.model.rules remove(long ruleId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.targeter.rulesengine.NoSuchrulesException;

	public com.targeter.rulesengine.model.rules updateImpl(
		com.targeter.rulesengine.model.rules rules, boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the rules with the primary key or throws a {@link com.targeter.rulesengine.NoSuchrulesException} if it could not be found.
	*
	* @param ruleId the primary key of the rules
	* @return the rules
	* @throws com.targeter.rulesengine.NoSuchrulesException if a rules with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.targeter.rulesengine.model.rules findByPrimaryKey(long ruleId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.targeter.rulesengine.NoSuchrulesException;

	/**
	* Returns the rules with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param ruleId the primary key of the rules
	* @return the rules, or <code>null</code> if a rules with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.targeter.rulesengine.model.rules fetchByPrimaryKey(long ruleId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns all the ruleses where ruleName = &#63;.
	*
	* @param ruleName the rule name
	* @return the matching ruleses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.targeter.rulesengine.model.rules> findByRuleName(
		java.lang.String ruleName)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the ruleses where ruleName = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param ruleName the rule name
	* @param start the lower bound of the range of ruleses
	* @param end the upper bound of the range of ruleses (not inclusive)
	* @return the range of matching ruleses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.targeter.rulesengine.model.rules> findByRuleName(
		java.lang.String ruleName, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the ruleses where ruleName = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param ruleName the rule name
	* @param start the lower bound of the range of ruleses
	* @param end the upper bound of the range of ruleses (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching ruleses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.targeter.rulesengine.model.rules> findByRuleName(
		java.lang.String ruleName, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the first rules in the ordered set where ruleName = &#63;.
	*
	* @param ruleName the rule name
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching rules
	* @throws com.targeter.rulesengine.NoSuchrulesException if a matching rules could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.targeter.rulesengine.model.rules findByRuleName_First(
		java.lang.String ruleName,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.targeter.rulesengine.NoSuchrulesException;

	/**
	* Returns the first rules in the ordered set where ruleName = &#63;.
	*
	* @param ruleName the rule name
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching rules, or <code>null</code> if a matching rules could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.targeter.rulesengine.model.rules fetchByRuleName_First(
		java.lang.String ruleName,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the last rules in the ordered set where ruleName = &#63;.
	*
	* @param ruleName the rule name
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching rules
	* @throws com.targeter.rulesengine.NoSuchrulesException if a matching rules could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.targeter.rulesengine.model.rules findByRuleName_Last(
		java.lang.String ruleName,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.targeter.rulesengine.NoSuchrulesException;

	/**
	* Returns the last rules in the ordered set where ruleName = &#63;.
	*
	* @param ruleName the rule name
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching rules, or <code>null</code> if a matching rules could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.targeter.rulesengine.model.rules fetchByRuleName_Last(
		java.lang.String ruleName,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the ruleses before and after the current rules in the ordered set where ruleName = &#63;.
	*
	* @param ruleId the primary key of the current rules
	* @param ruleName the rule name
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next rules
	* @throws com.targeter.rulesengine.NoSuchrulesException if a rules with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.targeter.rulesengine.model.rules[] findByRuleName_PrevAndNext(
		long ruleId, java.lang.String ruleName,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.targeter.rulesengine.NoSuchrulesException;

	/**
	* Returns all the ruleses.
	*
	* @return the ruleses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.targeter.rulesengine.model.rules> findAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the ruleses.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of ruleses
	* @param end the upper bound of the range of ruleses (not inclusive)
	* @return the range of ruleses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.targeter.rulesengine.model.rules> findAll(
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the ruleses.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of ruleses
	* @param end the upper bound of the range of ruleses (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of ruleses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.targeter.rulesengine.model.rules> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the ruleses where ruleName = &#63; from the database.
	*
	* @param ruleName the rule name
	* @throws SystemException if a system exception occurred
	*/
	public void removeByRuleName(java.lang.String ruleName)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the ruleses from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of ruleses where ruleName = &#63;.
	*
	* @param ruleName the rule name
	* @return the number of matching ruleses
	* @throws SystemException if a system exception occurred
	*/
	public int countByRuleName(java.lang.String ruleName)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of ruleses.
	*
	* @return the number of ruleses
	* @throws SystemException if a system exception occurred
	*/
	public int countAll()
		throws com.liferay.portal.kernel.exception.SystemException;
}